<?php

namespace addons\shopro\controller;

use think\Validate;

/**
 * 轮播图接口
 */
class Banners extends Base
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];

    /**
     * 首页
     *
     */
    public function index()
    {
        $data = \app\admin\model\Banners::field('id,title,url')->select();

        $host = $this->request->domain();
        foreach ($data as &$item){
            $item->url = $host.$item->url;
        }

        $this->success('请求成功',$data);

    }

}
